# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
require "common"

class ApplicationController < ActionController::Base
  helper :all # include all helpers, all the time
  protect_from_forgery # See ActionController::RequestForgeryProtection for details
  rescue_from 'Acl9::AccessDenied', :with => :access_denied
  
  include AuthenticatedSystem
  include ExceptionNotifiable

  # Scrub sensitive parameters from your log
  filter_parameter_logging :password, :password_confirmation, :email
  
  #before_filter :language
  
	layout "application"
	
	private
	  	  
	  def language
    	render_404 unless ([nil] + AVAILABLE_LOCALES).include?(current_subdomain)
    	I18n.locale = current_subdomain || I18n.default_locale
    end
end
